package com.itlaobing.annotation;

import java.lang.reflect.Field;

public class AnnoTest2 {

    public static void main(String[] args) throws NoSuchFieldException, IllegalAccessException {

        Class<?> c = Human.class ; // 获得类
        Field f = c.getDeclaredField( "name" ); // 获得字段

        // 从 f 字段上 获取 Assign 注解
        Assign a = f.getDeclaredAnnotation( Assign.class ); // Java 8 新增的方法
        System.out.println( a );

        Class<?> annoClass = a.getClass();
        System.out.println(annoClass);

        Class<?> pc = annoClass.getSuperclass();
        System.out.println(pc.getName());

        Class<?>[] interfaces =  annoClass.getInterfaces();

    }
}
